(function($f) {	$f.extend.feature("myFeature1", "myPlugin1, myPlugin2", "4c66b938-5b8f-4a61-b76d-498d107f15ce", function(self) {

	"use strict";
	
	// feature info
	this.featureInfo = {
		title: "My Feature 1",
		version: "0.0.1" // major.minor.build
	};

	// feature only (non-merged) config
	this.featureConfig = {
		// define all forward names that it can handle, forwards will come only
		// if name is listed here, define each forward name as: 'forwardEvent1Name', 'forwardEvent2Name', ...
		canHandleForwards: "'beforeSaveState', 'afterLoadState', "
	};
	
	// feature state (contents here-in must be JSON serializable)
	// if items are defined here, these will be preserved across page refresh (by 
	// serializing/deserializing transparently)
	this.state = { 
		var5: 1000,
		var6: Date.now(),
		var7: "myFeature1 String for " + self.handle.name,
		var8: true,
		var9: {key1: "key1Value"}
	};
	
	// handle parent forwards
	// parent may choose to forward certain scenarios for features to handle
	// feature should know in advance what forwards can come by their exact name
	// params:
	//	forwardName (string): forward name
	//	args (object literal): arguments 
	// returns (object): depends on what forward it is
	this.onParentForward = function(forwardName, args) {
		// handle forward
		var returnValue = null;
		switch(forwardName) {
			case "beforeSaveState": 
				// change value 
				var oldValue = self.state.var5;
				self.state.var5 = self.state.var5 + 5000;
				
				// log (although this will not show up in events log - because DOM is cleared on page refresh)
				$("#eventsLog").append("<p>beforeSaveState: state value of var5 of myFeature1 of " + self.handle.name + " is changed from " + oldValue.toString() + " to " + self.state.var5.toString() + " for storage.");
						
				break;
			case "afterLoadState": 
				// restore value
				self.state.var5 = self.state.var5 - 5000;

				// log
				$("#eventsLog").append("<p>afterLoadState: state value of var5 of myFeature1 of " + self.handle.name + " is restored to " + self.state.var5.toString() + ".");
				break;
		};
		
		// return
		return returnValue;
	};
}); }(fluid));
